<!DOCTYPE html>
<html lang="en" xmlns:C="http://java.sun.com/jsp/jstl/core" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?" rel="stylesheet">
    <link href="css/font-awesome.css?" rel="stylesheet">

    <!-- jqgrid-->
    <link href="css/plugins/jqgrid/ui.jqgrid.css" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <title>增加商品</title>

</head>

<body>
<div class="ibox-title">
                <div class="ibox-title actions-container">
                    <button id="return" type="button" class="btn btn-primary btn-sm">
                        <a href="/listProduct" style="color: white;">返回列表</a>
                    </button>
                </div>
                <form class="form-horizontal m-t" id="commentForm" novalidate="novalidate"
                      action="/addProduct">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">产品名：</label>
                        <div class="col-sm-6">
                            <input id="product_name" name="product_name" minlength="2" type="text"
                                   class="form-control" required="" aria-required="true">
                        </div>
                    </div>
                    <!-- 品牌 -->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">品牌：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select id="brandSelect" name="brand_name" class="form-control">
                                        <option value="">-- 请选择 --</option>
                                        <option th:each="brand:${brands}"
                                                th:value="${brand.brand_name}"
                                                th:text="${brand.brand_name}"
                                        ></option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <button id="addBrandBtn"
                                            type="button"
                                            class="btn btn-primary btn-sm"
                                    >
                                        <a href="/toAddBrand" style="color: white;">
                                            增加品牌
                                        </a></button>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!-- 类型 -->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">类型：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select id="typeSelect" name="type_name" class="form-control">
                                        <option value="">-- 请选择 --</option>
                                        <option th:each="type:${types}"
                                                th:value="${type.type_name}"
                                                th:text="${type.type_name}"
                                        ></option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <button id="addTypeBtn" type="button" class="btn btn-primary btn-sm">
                                        <a href="/toAddType" style="color: white;">增加类型</a>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>


                    <!-- 产地 -->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">产地：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select id="placeSelect" name="place_name" class="form-control">
                                        <option value="">-- 请选择 --</option>
                                        <option th:each="place:${places}"
                                                th:value="${place.place_name}"
                                                th:text="${place.place_name}">
                                        </option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <button id="addPlaceBtn" type="button" class="btn btn-primary btn-sm">
                                        <a href="/toAddPlace" style="color: white;">增加产地</a>
                                        </button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">供应商：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select id="supplySelect" name="supply_name" class="form-control">
                                        <option value="">-- 请选择 --</option>
                                        <option th:each="supply:${supplyList}"
                                                th:value="${supply.supply_name}"
                                                th:text="${supply.supply_name}"
                                        ></option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                <button id="addSupplyBtn" type="button" class="btn btn-primary btn-sm">
                                    <a href="/toAddSupply" style="color: white;">增加供应商</a>
                                    </button>
                                </div>
                            </div>

                        </div>
                    </div>

                    <!-- 仓库 -->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">仓库：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select id="storeSelect" name="store_name" class="form-control">
                                        <option value="">-- 请选择 --</option>
                                        <option th:each="store : ${stores}"
                                                th:value="${store.store_name}"
                                                th:text="${store.store_name}"></option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <button id="addStoreBtn" type="button" class="btn btn-primary btn-sm">
                                        <a href="/toAddStore" style="color: white;">增加仓库</a>
                                        </button>
                                </div>
                            </div>

                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-3 control-label">数量：</label>
                        <div class="col-sm-6">
                            <input id="product_num" name="product_num" class="form-control" required=""
                                   aria-required="true">
                        </div>
                    </div>
                    <!-- 单位 -->
                    <div class="form-group">
                        <label class="col-sm-3 control-label">单位：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select id="unitSelect" name="unit_name" class="form-control" >
                                        <option value="">-- 请选择 --</option>
                                        <option th:each="unit : ${units}"
                                                th:value="${unit.unit_name}"
                                                th:text="${unit.unit_name}"></option>
                                    </select>
                                </div>
                                <div class="col-sm-3">
                                    <button id="addUnitBtn" type="button" class="btn btn-primary btn-sm">
                                        <a href="/toAddUnit" style="color: white;">增加单位</a>
                                        </button>
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">介绍：</label>
                        <div class="col-sm-6">
                            <input id="introduce" name="introduce" class="form-control" required=""
                                   aria-required="true">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">进价：</label>
                        <div class="col-sm-6">
                            <input id="in_price" name="in_price" type="number" class="form-control" required=""
                                   aria-required="true" step="0.01" min="0">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">售价：</label>
                        <div class="col-sm-6">
                            <input id="sale_price" name="sale_price" type="number" class="form-control" required=""
                                   aria-required="true" step="0.01" min="0">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">上下架：</label>
                        <div class="col-sm-8">
                            <div class="row">
                                <div class="col-sm-9">
                                    <select class="form-control" style="height: 34px;" required="">
                                        <option value="1">上架</option>
                                        <option value="0">下架</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-6 col-sm-offset-3">
                            <div class="text-center">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </div>

                </form>


</div>


</body>
<script>
    window.onload = function() {
        // 获取下拉框元素
        var brandSelect = document.getElementById("brandSelect");

        // 打印下拉框的值
        console.log(brandSelect);
    }



</script>
</html>